using System;
using System.Data;
using System.Collections.Generic;

namespace SERP.DAO{
	/********************************BEGIN SalaryRuleItemsDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:09/03/2013 19:09:04</para>
	/// <para>Class Name: SalaryRuleItemsDAO</para>
	/// <para>Description: Class access to table SalaryRuleItems in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class SalaryRuleItemsDAO : DAOBase<SalaryRuleItemsEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: SalaryRuleItemId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int SalaryRuleItemId){
			string strSQL="SELECT  [SalaryRuleItemId],[SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex] FROM [SalaryRuleItems]  WHERE [SalaryRuleItems].[SalaryRuleItemId]=@SalaryRuleItemId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryRuleItemId",SalaryRuleItemId);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: SalaryRuleItemId</para>
		/// <para>Output: SalaryRuleItemsEntity</para>
		///</summary>
		public SalaryRuleItemsEntity SelectOne(int SalaryRuleItemId){
			IDbCommand cmd=this.CreateSelectOneCommand(SalaryRuleItemId);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [SalaryRuleItemId],[SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex] FROM [SalaryRuleItems] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [SalaryRuleItemId],[SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex] FROM [SalaryRuleItems]  WHERE [SalaryRuleItems].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SalaryRuleItemsEntity</para>
		///</summary>
		public List<SalaryRuleItemsEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [SalaryRuleItemId],[SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex] FROM [SalaryRuleItems]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [SalaryRuleItemId],[SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex] FROM [SalaryRuleItems]  WHERE [SalaryRuleItems].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SalaryRuleItemsEntity</para>
		///</summary>
		public List<SalaryRuleItemsEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(SalaryRuleItemsEntity o){
			string strSQL="INSERT INTO [SalaryRuleItems]([SalaryRuleId],[SalaryFieldId],[RuleContent],[CalculationType],[CalculationIndex]) VALUES  (@SalaryRuleId,@SalaryFieldId,@RuleContent,@CalculationType,@CalculationIndex);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryRuleId)
				this.CreateCommandParameter(cmd,"@SalaryRuleId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryRuleId",o.SalaryRuleId);

			if(o.IsNullSalaryFieldId)
				this.CreateCommandParameter(cmd,"@SalaryFieldId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryFieldId",o.SalaryFieldId);

			if(o.IsNullRuleContent)
				this.CreateCommandParameter(cmd,"@RuleContent",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@RuleContent",o.RuleContent);

			if(o.IsNullCalculationType)
				this.CreateCommandParameter(cmd,"@CalculationType",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@CalculationType",o.CalculationType);

			if(o.IsNullCalculationIndex)
				this.CreateCommandParameter(cmd,"@CalculationIndex",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@CalculationIndex",o.CalculationIndex);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Save</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(SalaryRuleItemsEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.SalaryRuleItemId=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of SalaryRuleItemsEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<SalaryRuleItemsEntity>list){
			foreach(SalaryRuleItemsEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(SalaryRuleItemsEntity o){
			string strSQL="UPDATE  [SalaryRuleItems] SET [SalaryRuleItems].[SalaryRuleId]=@SalaryRuleId,[SalaryRuleItems].[SalaryFieldId]=@SalaryFieldId,[SalaryRuleItems].[RuleContent]=@RuleContent,[SalaryRuleItems].[CalculationType]=@CalculationType,[SalaryRuleItems].[CalculationIndex]=@CalculationIndex WHERE [SalaryRuleItems].[SalaryRuleItemId]=@SalaryRuleItemId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryRuleId)
				this.CreateCommandParameter(cmd,"@SalaryRuleId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryRuleId",o.SalaryRuleId);

			if(o.IsNullSalaryFieldId)
				this.CreateCommandParameter(cmd,"@SalaryFieldId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryFieldId",o.SalaryFieldId);

			if(o.IsNullRuleContent)
				this.CreateCommandParameter(cmd,"@RuleContent",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@RuleContent",o.RuleContent);

			if(o.IsNullCalculationType)
				this.CreateCommandParameter(cmd,"@CalculationType",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@CalculationType",o.CalculationType);

			if(o.IsNullCalculationIndex)
				this.CreateCommandParameter(cmd,"@CalculationIndex",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@CalculationIndex",o.CalculationIndex);

			if(o.IsNullSalaryRuleItemId)
				this.CreateCommandParameter(cmd,"@SalaryRuleItemId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryRuleItemId",o.SalaryRuleItemId);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,SalaryRuleItemId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int SalaryRuleItemId){
			string strSQL="UPDATE  [SalaryRuleItems] SET [SalaryRuleItems].["+ColumnName+"]=@ColumnName WHERE [SalaryRuleItems].[SalaryRuleItemId]=@SalaryRuleItemId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryRuleItemId",SalaryRuleItemId);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Update</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(SalaryRuleItemsEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of SalaryRuleItemsEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<SalaryRuleItemsEntity>list){
			foreach(SalaryRuleItemsEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateSalaryRuleId</para>
		/// <para>Input: NewSalaryRuleId,SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSalaryRuleId(int NewSalaryRuleId,int SalaryRuleItemId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SalaryRuleId",NewSalaryRuleId,SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateSalaryFieldId</para>
		/// <para>Input: NewSalaryFieldId,SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSalaryFieldId(int NewSalaryFieldId,int SalaryRuleItemId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SalaryFieldId",NewSalaryFieldId,SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateRuleContent</para>
		/// <para>Input: NewRuleContent,SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateRuleContent(string NewRuleContent,int SalaryRuleItemId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("RuleContent",NewRuleContent,SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateCalculationType</para>
		/// <para>Input: NewCalculationType,SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateCalculationType(Byte NewCalculationType,int SalaryRuleItemId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("CalculationType",NewCalculationType,SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: UpdateCalculationIndex</para>
		/// <para>Input: NewCalculationIndex,SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateCalculationIndex(int NewCalculationIndex,int SalaryRuleItemId){
			IDbCommand cmd=this.CreateUpdateFieldCommand("CalculationIndex",NewCalculationIndex,SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [SalaryRuleItems]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(SalaryRuleItemsEntity o){
			string strSQL="DELETE   FROM [SalaryRuleItems]   WHERE [SalaryRuleItems].[SalaryRuleItemId]=@SalaryRuleItemId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSalaryRuleItemId)
				this.CreateCommandParameter(cmd,"@SalaryRuleItemId",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SalaryRuleItemId",o.SalaryRuleItemId);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: SalaryRuleItemId</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int SalaryRuleItemId){
			string strSQL="DELETE   FROM [SalaryRuleItems]   WHERE [SalaryRuleItems].[SalaryRuleItemId]=@SalaryRuleItemId";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SalaryRuleItemId",SalaryRuleItemId);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [SalaryRuleItems]   WHERE [SalaryRuleItems].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: Delete</para>
		/// <para>Input: SalaryRuleItemsEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(SalaryRuleItemsEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: SalaryRuleItemId</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int SalaryRuleItemId){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(SalaryRuleItemId);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to SalaryFieldsSalaryRules functions
		#endregion

		#region Select join to SalaryFields functions
		#endregion

		#region Select join to SalaryRules functions
		#endregion

		#region Select,delete by SalaryRuleItemId functions
		#endregion

		#region Select,delete by SalaryRuleId functions
		#endregion

		#region Select,delete by SalaryFieldId functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:09/03/2013 19:09:04</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: SalaryRuleItemsEntity</para>
		///</summary>
		protected override SalaryRuleItemsEntity MapObject(IDataReader r){
			SalaryRuleItemsEntity entity = new SalaryRuleItemsEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("SalaryRuleItemId");
						if (!r.IsDBNull(ordinal)) entity.SalaryRuleItemId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SalaryRuleId");
						if (!r.IsDBNull(ordinal)) entity.SalaryRuleId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SalaryFieldId");
						if (!r.IsDBNull(ordinal)) entity.SalaryFieldId = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("RuleContent");
						if (!r.IsDBNull(ordinal)) entity.RuleContent = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("CalculationType");
						if (!r.IsDBNull(ordinal)) entity.CalculationType = ((Byte)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("CalculationIndex");
						if (!r.IsDBNull(ordinal)) entity.CalculationIndex = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END SalaryRuleItemsDAOBase*****************************************/
	/*****************************************************************************************************/
}

